add sar_trace_sync#368
Conversation
| trace_ticks[h.trace_name] = tick; | ||
| } | ||
|
|
||
| auto fastest_trace = playerTrace->GetTrace(fastest_trace_name); |
There was a problem hiding this comment.
Unused variables fastest_trace_name, fastest_trace
Krzyhau
left a comment
There was a problem hiding this comment.
Separately handled state for offset sounds weird to me. It should be a part of trace data that gets reset/removed along with the trace itself. In most cases, when you're doing comparisons, the original trace is recorded once.
Additionally, since you're adding offset anyway, it might be useful to leave a command for explicitly defining it for various purposes. sar_trace_offset [trace_name] [offset]. This would also allow you to keep offset of the trace after re-recording if you wish to constantly re-record comparison traces with offsets for whatever reason.
| // Universal map for trace tick offsets to be able to preserve them between trace recordings | ||
| std::unordered_map<std::string, int> tickOffsets; |
There was a problem hiding this comment.
You've created extra trace information which is implicitly not cleared when removing traces. I'm not a fan of that and I'd like to know what justifies this choice.
There was a problem hiding this comment.
I wanted to make trace offset not get reset if you rerecorded a trace so I needed to store the offsets somewhere that isn't inside the trace itself
| } | ||
| } | ||
|
|
||
| CON_COMMAND(sar_trace_sync, "sar_trace_sync - syncs all the hovered traces to the fastest trace.\n") { |
There was a problem hiding this comment.
What if we don't want to compare to the trace that's fastest? What if our other traces we're comparing to are faster instead?
I think this feature would be more versatile if you could specify which trace to sync to (that is, sar_trace_sync_all_to [trace_name])
There was a problem hiding this comment.
I already implemented this but I guess I forgot to push it
this was the first thing I implemented but changed it to sync cause i felt I wouldn't need to manually set offset and would just always use sync. also I couldn't find a way to be able to both set offsets and see them I was happy with, the thing I had just used auto complete to show the trace name and offset |
this is for comparing two traces of tases so you look at a place where they intersect and using the command make the ticks of both tases at the point the same by subtracting some amount of ticks from the slower tas making the bbox be forwarder and aligned with the faster tas
didn't test linux